# %.o:%.c 根据对应的.o匹配对应的.c文件

DIR_INC = -I ./fun
DIR_SRC = ./fun
DIR_OBJ = ./obj
CC = gcc

all: $(DIR_OBJ)/fun.o $(DIR_OBJ)/ech.o $(DIR_OBJ)/main.o
	$(CC) $^ -o $(DIR_OBJ)/all

$(DIR_OBJ)/%.o: $(DIR_SRC)/%.c
	$(CC) -c $< -o $@

$(DIR_OBJ)/main.o: ./main.c	
	$(CC) -c $< -o  $@ $(DIR_INC)


.PHONY:clean
clean:
	rm $(DIR_OBJ)/*.o $(DIR_OBJ)/all